package com.ghca.myinfo3.system.service.impl;

import com.ghca.myinfo3.system.entity.Department;
import com.ghca.myinfo3.system.mapper.DepartmentMapper;
import com.ghca.myinfo3.system.repository.DepartmentRepository;
import com.ghca.myinfo3.system.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2016/12/24.
 */
@Service
public class DepartmentService implements IDepartmentService {

    @Resource
    private DepartmentRepository departmentRepository;

    @Resource
    private DepartmentMapper departmentMapper;


    @Value("${myinfo.company.name:}")
    private String name;


    @Override
    public List<Department> list(Long parentId) {
       // List<Department> list = departmentMapper.selectByParentId(parentId);
        List<Department> list = departmentRepository.findByParentId(parentId);
        return list;
    }
}
